/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.client.vdialog.model.template;

import offset.nodes.client.vdialog.model.template.AbstractTemplateNode;

/**
 *
 * @author Walter Lütgenau
 */
public class PathNode extends AbstractTemplateNode {
    private String name;
    private String nameProperty;
    String representationUuid;
    boolean residual = true;
    
    /** Creates a new instance of TemplateNode */
    public PathNode(String type) {
        super(type);
        setName("");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNameProperty() {
        return nameProperty;
    }

    public void setNameProperty(String nameProperty) {
        this.nameProperty = nameProperty;
    }

    public String getRepresentationUuid() {
        return representationUuid;
    }

    public void setRepresentationUuid(String representationUuid) {
        this.representationUuid = representationUuid;
    }

    public boolean isResidual() {
        return residual;
    }

    public void setResidual(boolean residual) {
        this.residual = residual;
    }

    public String toString() {
        if ( getName() != null && getName().length() > 0)
            return getName();
        
        if ( getNameProperty() != null)
            return getQuery() + "/@" + getNameProperty();
        
        return "";
    }

}
